package homework4;

public class pizzaFactory {
	//生产不同口味的比萨对象
		public static pizza getPizza(
				int typeId,
				String name,
				double price,
				int size,
				int grammage,
				String ingredient) {
			//定义父类引用
			Pizza pizza  = null;
			switch(typeId) {
			case 1:
				pizza = new BaconPizza(name, price, size, grammage);
				break;
			case 2:
				pizza = new pizza(name, price, size, ingredient);
				break;
			}
			//返回父类对象引用
			return pizza;
		}

}
